POV-Ray : Newsgroups : povray.general : image map on cone - help me understand : image map on cone - help me understand Server Time
1 Aug 2024 12:22:44 EDT (-0400)
  image map on cone - help me understand  
From: Rick DeNatale
Date: 11 Oct 2005 17:21:51
Message: <434c2cef@news.povray.org>
I'm modeling a Mercury spacecraft, and I'm trying to use an image map
for some markings like the words UNITED/STATES and the American flag.

The main cabin of the spacecraft which I'm trying to texture with an
image_map is a truncated cone with an included angle of 40 degrees (or
another way of saying this is that the sides are 20 degrees from the
vertical.  Because of the drawings I'm using the cone is centered on the
Z axis.

The particular markings I'm starting with a the words UNITED and STATES
vertically stacked with a small flag underneath.  The tops and bottoms
of each word and the flag run along the circles defined by the
intersection of the cone and planes parallel to the X-Y plane.  The
sides lie on lines which run from the apex of the cone (if it were not
truncated), to the base of the cone.

So right now I've got something like this:

#declare ConeTopRadius = 16;
#declare ConeBotRadius = 37.25;
#declare ConeTopZ = 161.71;
#declare ConeBotZ = 103.18;

#declare CabinCone = {
    Cone {
       <0,0,ConeBotZ>, ConeTopRadius,
       <0,0,ConeTopZ>, ConeBotRadius
    }
}

#declare Cabin = object {
   object { CabinCone }
   texture { ReneMetal }
   texture {
     pigment {
       image_map {
         png "maps/testmap.png"
         map_type_2 // cylindrical map
         once
         scale <1, ConeTopZ-ConeBotZ,1>
         rotate x*90  // put it concentric with the cone
         translate z*ConeBotZ
       }
     }
   }
}

The png is transparent with just the words and the flag with the words
laid out normally.  I didn't go to great pains to make the aspect ratio
of the image "correct" whatever that is, it's roughly the height of the
truncated cone to the large circumference.

The effect I'm getting is just the opposite of what I want, the tops of
the words and flag are wider than the bottom rather than narrower which
is what I want.  I don't understand how the image is being projected
onto the cone well enough to understand what I'm seeing.  I got the
scaling above by playing,

I'm guessing that I'm going to somehow distort the original png image by
keystoning parts, or is there a better way to accomplish what I want?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.